﻿namespace TestProject
{
    using System.Diagnostics;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using Swiss;
    using TestProject.TestWrapper_Data;

    /// <summary>
    /// Summary description for UnitTest1
    /// </summary>
    [TestClass]
    public class Data_Tests
    {
        public Data_Tests()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Data

        [TestMethod]
        public void TestData()
        {
            using (Serie<Setup, Measurement> serie = Serie<Setup, Measurement>.Instance)
            {
                serie.LoadFromFile("test.ini");
                Debug.WriteLine("Dirty: " + serie.Dirty.ToString());

                Measurement m = serie.AddNew().Measurement;
                Debug.WriteLine("Dirty: " + serie.Dirty.ToString());
                m.Value = 19;

                //Saving to Ini!
                serie.SaveToFile("test.ini");

                //Saving to Storage!
                serie.SaveToStorage("test.dat");
            }
        }

        #endregion Data
    }
}
